<template>
  <div>
    <h1>TsInfo</h1>
    username : {{ username }}
    <hr>
    age : {{ age }}

  </div>
</template>
<script setup>
import { inject } from 'vue';
import { injectUsername } from "../key.js";

// 注入
const username = inject(injectUsername);
const age = inject('age');
</script>